import request from '../utils/request'


export function login(data) {
  return request({
    url: '/oauth/api/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/blog/user/',
    method: 'get',
    params: { access_token: token }
  })
}

export function logout() {
  return request({
    url: '/oauth/api/logout',
    method: 'post'
  })
}


export function editUser(data) {
  return request({
    url: '/blog/user/',
    method: 'put',
    data
  })
}

export function addUser(data) {
  return request({
    url: '/blog/user/',
    method: 'post',
    data
  })
}

export function getUserByNickName(nickname) {
  return request({
    url: '/blog/user/',
    method: 'get',
    params:{
      nickname:nickname
    }
  })
}

export function getUserByUserName(username) {
  return request({
    url: '/blog/user/',
    method: 'get',
    params:{
      username:username
    }
  })
}

export function getFriendsLink() {
  return request({
    url: '/blog/user/',
    method: 'get',
    params:{
      shareFlag:1
    }
  })
}





